package com.code.google.mdsc.control;

import java.io.File;

import com.code.google.mdsc.gui.MainWindow;
import com.code.google.mdsc.model.Creditor;

/**
 * {@link Business} encapsulates the control part of the program.
 * 
 */
public interface Business {

	void exit();

	/**
	 * 
	 * @param selectedFile
	 *            must not be <code> null </code>
	 * @param mw
	 *            must not be <code> null </code>
	 * 
	 * @throws IllegalArgumentException
	 *             if a given parameter is invalid
	 */
	void saveAsXML(File selectedFile, MainWindow mw);

	/**
	 * 
	 * @param selectedFile
	 *            must not be <code> null </code>
	 * @param mw
	 *            must not be <code> null </code>
	 * 
	 * @throws IllegalArgumentException
	 *             if a given parameter is invalid
	 */
	void loadFromCSV(File selectedFile, MainWindow mw);

	/**
	 * 
	 * @param mw
	 *            must not be <code> null </code>
	 * @param values
	 *            must not be <code> null </code>
	 * 
	 * @throws IllegalArgumentException
	 *             if a given parameter is invalid
	 */
	void search(MainWindow mw, String[] values);

	Creditor getCreditorData();

	/**
	 * 
	 * @param creditor
	 *            must not be <code> null </code>
	 * 
	 * @throws IllegalArgumentException
	 *             if a given parameter is invalid
	 */
	void setCreditorData(Creditor creditor);

}
